package cn.yotta.user.core.web.controller.common;

import cn.yotta.user.core.server.service.UserService;
import cn.yotta.user.web.autoconfiguration.context.user.UserContext;
import cn.yotta.user.web.autoconfiguration.provider.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wyaoyao
 * @date 2023/3/13 7:37
 */
@RestController
@RequestMapping("user/common/")
@Api(tags = "用户服务")
public class UserCommonController {

    private final UserService userService;

    public UserCommonController(UserService userService) {
        this.userService = userService;
    }

    @ApiOperation("获取登录用户上下文信息")
    @GetMapping("currentUser")
    public LoginUser currentUser() {
        return UserContext.get();
    }


}
